package com.qu.waibao.home.adpater;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.qu.waibao.R;
import com.qu.waibao.base.BaseRecyclerAdapter;
import com.qu.waibao.bean.OtherService;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by Administrator on 2018/8/1.
 */

public class TypeAdpater extends BaseRecyclerAdapter<OtherService.ServicecategoryBean> {
    public TypeAdpater(Context context, int mode) {
        super(context, mode);
    }

    @Override
    protected RecyclerView.ViewHolder onCreateDefaultViewHolder(ViewGroup parent, int type) {
        return new TypeViewHolder(mInflater.inflate(R.layout.type_recycler_item,parent,false));
    }

    @Override
    protected void onBindDefaultViewHolder(RecyclerView.ViewHolder holder,
                                           OtherService.ServicecategoryBean item, int position) {
        TypeViewHolder typeViewHolder = (TypeViewHolder) holder;
        typeViewHolder.tv_content.setText(item.getServicecategoryname());
    }

    class TypeViewHolder extends RecyclerView.ViewHolder{
        @BindView(R.id.tv_content)
        TextView tv_content;
        public TypeViewHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this,itemView);
        }
    }
}
